package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * Servlet implementation class servlet.uppaper
 */
@WebServlet("/servlet.uppaper")
public class uppaper extends HttpServlet {
	private static final long serialVersionUID = 1L;
	sqliteDo slqlt;
	List<String> list;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public uppaper() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		slqlt = new sqliteDo();
		// TODO Auto-generated method stub
		//response.getWriter().append("Served at: ").append(request.getContextPath());
		String title = request.getParameter("title");
		String text = request.getParameter("text");
		String auther = request.getParameter("auther");
		String date = request.getParameter("date");
		//text = text.substring(3,text.length()-8);
		System.out.println("title: "+title+"   text: "+text+"   auther: "+auther+"   date: "+date);
		slqlt.insertTalk(title, text,auther,date);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
